Use live quotes in Firstrade price history#48
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fc3be349c6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| quote_point = PricePoint(as_of=quote.as_of, close=quote.last_price) | ||
| last_market_date = _market_date(points[-1].as_of) | ||
| quote_market_date = _market_date(quote_point.as_of) | ||
| if quote_market_date > last_market_date: | ||
| points.append(quote_point) |
There was a problem hiding this comment.
Avoid dating stale quotes as new daily bars
When get_price_series() runs on a weekend/holiday or after midnight ET before a new OHLC candle exists, load_quote() stamps the quote with self.clock() rather than the trade timestamp, so this appends an artificial market-history point for a non-trading day. The client already exposes quote_time/last_trade_time in get_quote() (application/firstrade_client.py), but they are ignored here; strategies consuming market_history/derived indicators will see an extra daily bar even though the last trade was on the previous market session.
Useful? React with 👍 / 👎.
Summary
Tests
Note: local .venv does not include ruff, so ruff was not run locally.